<html>
<head>
<title>Photo Album</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="/bundle/sharing.css" type="text/css" />
<script type="text/javascript" src="/bundle/swfobject.js"></script>
</head>
<body>
<script language="javascript">

var current_link = -1;
var default_backgrounds = new Array();
var default_colors = new Array();
var setup_defaults = false;
var go_next = '';
var go_context = '/p';

function setupDefaults ()
{
	if (!setup_defaults) {
		setup_defaults = true;
		for (i = 0; i < document.links.length; i++) {
			default_colors[i] = document.links[i].style.color;
			default_backgrounds[i] = document.links[i].style.backgroundColor;
		}
	}
}

document.onkeypress = function (e) {
	setupDefaults();
	
	if ((e.keyCode == 175) || (e.keyCode == 63232)) {
		highlightPreviousLink();
		return false;
	}
	else if ((e.keyCode == 176) || (e.keyCode == 63233)) {
		highlightNextLink();
		return false;
	}
	else if ((e.keyCode == 177) || (e.keyCode == 63235)) {
		if (go_next.length > 0) {
			location.href = go_next + '?r=' + Math.random();
		}
		else {
			gotoCurrentLink();
		}
		return false;
	}
	else if (e.keyCode == 13) {
		gotoCurrentLink();
		return false;
	}
	else if ((e.keyCode == 178) || (e.keyCode == 63234)) {
		location.href = go_context + '?r=' + Math.random();
		return false;
	}
	else {
		return true;
	}
}

function resetHighlightLinks ()
{
	for (i = 0; i < document.links.length; i++) {
		proto = document.links[i].style.color = default_colors[i];
		proto = document.links[i].style.backgroundColor = default_backgrounds[i];
	}
}

function highlightCurrentLink ()
{
	resetHighlightLinks();
	document.links[current_link].style.color = 'black';
	document.links[current_link].style.backgroundColor = '#fff8d2';
	x = document.links[current_link].offsetTop;
	scroll_x = x - (window.innerHeight / 2);
	if (scroll_x > 0) {
		window.scrollTo (0, scroll_x);
	}
}

function highlightPreviousLink ()
{
	current_link = current_link - 1;
	if (current_link < 0) {
		current_link = 0;
		window.scrollTo (0, 0);
	}
	else {
		highlightCurrentLink();
	}
}

function highlightNextLink ()
{
	current_link = current_link + 1;
	if (current_link >= document.links.length) {
		current_link = current_link - 1;
	}
	else {
		highlightCurrentLink();
	}
}

function gotoCurrentLink ()
{
	if (current_link >= 0) {
		page = document.links[current_link].href;
		location.href = page;
	}
}

</script>
<div id="image_rotator">Requires Flash</div>

<script type="text/javascript">

var swf = new SWFObject("/bundle/imagerotator.swf", "line", "100%", "100%", "7");
swf.addVariable("file","[image_xml]");
swf.addVariable("linkfromdisplay","false");
swf.addVariable("rotatetime","[rotate_seconds]");
swf.addVariable("shuffle","false");
swf.addVariable("transition","fade");
swf.addVariable("shownavigation","false");
swf.addVariable("overstretch","true");
swf.addVariable("largecontrols","true");
swf.addVariable("backcolor","0x000000");
swf.addVariable("frontcolor","0xCCCCCC");
swf.addVariable("lightcolor","0xD1EDF8");
swf.addVariable("audio","[background_music]");
swf.addVariable("useaudio","true");
swf.write("image_rotator");

</script>

</body>
</html>